################################################################################
## MOD Title:		Second Profilepage button in the viewtopic - Version 2
## MOD Author:		AmigaLink < webmaster@amigalink.de > (Markus Schmidt) http://www.EssenMitFreude.info
## 
## MOD Description:	Changes the profile button in viewtopic if poster has a second profilepage.
## 
## Installation Level:	easy
## Installation Time:	2 Minutes 
##
## Files To Edit:  	2
##			memberlist.php
##
##			templates/subSilver/subSilver.cfg
##
## Included Files:	2
##
##			templates/subSilver/images/lang_english/icon_profile_ex.gif
##			templates/subSilver/images/lang_german/icon_profile_ex.gif
##
################################################################################
## The following sites also contain the latest version of this MOD: 
## 
## http://www.AmigaLink.de
## 
## Full support for this MOD can be obtained at: 
##
## http://www.AmigaLink.de
##  
################################################################################
## Mod Notes:
##
##	This is a goodie for the easyUCP extension - Second Profilepage.
##	You must install that MODs first!
##
################################################################################
## MOD History: 
## 
##   2006-04-26 - Version 1.0.1
##	- little change to solve a problem at some boards
##
##   2006-03-07 - Version 1.0.0
##	- First Version
## 
################################################################################
##
##  This hack is released under the GPL License. 
##  This hack can be freely used, but not distributed, without permission.
##  Intellectual Property Rights are retained by the hack author(s) 
##  listed above.
##
################################################################################
##
##  BEFORE ADDING THIS HACK TO YOUR FORUM, please be sure to backup ALL
##  affected files.
##
################################################################################ 
#
#----------[ COPY FILES ]-------------------------------
#
#  Copy / upload the following files to your phpBB root directory.
#  The phpBB root directory is the directory on your server containing index.php
#

templates/subSilver/images/lang_english/icon_profile_ex.gif to templates/subSilver/images/lang_english/icon_profile_ex.gif
templates/subSilver/images/lang_german/icon_profile_ex.gif to templates/subSilver/images/lang_german/icon_profile_ex.gif

#
#----------[ OPEN ]-------------------------------------
#

templates/subSilver/subSilver.cfg

#
#----------[ FIND ]-------------------------------------
#

$images['icon_profile'] = "$current_template_images/{LANG}/icon_profile.gif";

#
#----------[ AFTER, ADD ]-------------------------------
#

$images['icon_profile_ex'] = "$current_template_images/{LANG}/icon_profile_ex.gif";

#
#----------[ OPEN ]-------------------------------------
#

viewtopic.php

#
#----------[ FIND ]-------------------------------------
#

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_lang, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid,

#
#----------[ INLINE FIND ]------------------------------
#

u.user_allow_viewonline

#
#----------[ INLINE AFTER, ADD ]------------------------
#

, u.user_allow_viewprofile_2

#
#----------[ FIND ]-------------------------------------
#

		$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';

#
#----------[ AFTER, ADD ]-------------------------------
#

// <!-- BEGIN easyUCP -->
		$second_page_allowed = false;
		if ( $postrow[$i]['user_allow_viewprofile_2'] != '-2' )
		{
			if ( $postrow[$i]['user_allow_viewprofile_2'] == ANONYMOUS || $userdata['user_level'] == ADMIN )  // Gste
			{
				$second_page_allowed = true;
			}
			else if ( $userdata['session_logged_in'] && $row['user_allow_viewprofile_2'] == USER || $userdata['user_level'] == MOD )  // User
			{
				$second_page_allowed = true;
			}
			else
			{
				$second_page_allowed = false;
			}
		}
		if ( $second_page_allowed )
		{
			$profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile_ex'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>';
			$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';
		}
// <!-- END easyUCP -->

#
#----------[ SAVE AND CLOSE ALL FILES ]-----------------
#
# EoM